home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 54.zip / BS part 54 / ImageMaster_d1.adf / install-im < prev    next >
Encoding:
Text File  |  1992-10-05  |  19.0 KB  |  526 lines

  1. ; CBM installer script to install Imagemaster on users hard-drive
  2. ;          by: Ben Williams
  3. ;     Written: Aug 26/92
  4. ;     Updates: Oct  5/92 - dctv.library added to distribution to read dctv pix
  5. ;              Sep 30/92 - Adds "wipes" dir to RXPI: for transition generator
  6. ;                        - Fixes doc & dev installs so they work better
  7. ;                        - Removes "takes time req", substitutes CON: windows
  8. ;              Sep 24/92 - Extract now OVER-writes; RE-installs work ok now
  9. ;              Aug 31/92 - Non-prompting assignment checks added
  10. ;----------------------------------------------------------------
  11. ;Notes:
  12. ;------->
  13. ;  (1) We force a minimum level of AVERAGE user so that they
  14. ;      must specify the target directory for the install and
  15. ;      answer some basic questions such as "Do you have an FPU"
  16. ;
  17. ;  (2) There must be sufficient diskspace to install the software
  18. ;      or we won't even try to install.
  19. ;
  20. ;  (3) ARexx must be available, or we won't try to install
  21. ;----------------------------------------------------------------
  22.  
  23. ; cleanup routine
  24. ;----------------
  25. (onerror)
  26.  
  27. ; Make certain rexx: directory exists - if ARexx isn't running, we
  28. ; can (sortof) live with that, though the user will be seriously
  29. ; crippled in capability. If no assignment exists, we're toast
  30. ;-----------------------------------------------------------------
  31. (if (= (getassign "rexx") "")
  32.     (abort "Cannot install - no REXX: assignment in this system. "
  33.            "You MUST have ARexx and a drawer assigned to REXX: "
  34.            "to hold ARexx scripts in order to successfully "
  35.            "install Imagemaster. Please properly configure "
  36.            "your computer and try again. If you do not know how "
  37.            "to accomplish this, call your dealer or consultant."
  38.     )
  39. )
  40.  
  41. ; Find out where user wants to put Imageaster
  42. ;----------------------------------------------
  43. (set user_place
  44.     (askdir
  45.         (prompt "Where shall we place the Imagemaster DRAWER? ")
  46.         (help @askdir-help "It is important that you realize that the destination you specify here "
  47.                            "is for the DRAWER in which Imagemaster and it's associated data files "
  48.                            "will be placed. Even if this is an update to an earlier installation, "
  49.                            "you still need to specify this location the same way. Otherwise, a new "
  50.                            "\"Imagemaster\" drawer will be created INSIDE your old one, causing "
  51.                            "much confusion and not amusing anyone.")
  52.         (default @default-dest)
  53.     )
  54. )
  55.  
  56. ; Check to see if assigns are already made
  57. ;-----------------------------------------
  58. (set as_made 0)
  59. (if (<> (getassign "rxpi:") "")
  60.     (if (<> (getassign "cmpi:") "")
  61.         (set as_made 1)
  62.     )
  63. )
  64.  
  65. ; Find out if user wants the developer code
  66. ;------------------------------------------
  67. (set dev_install
  68.     (askoptions
  69.         (prompt "Would you like to have the Public Interface developer "
  70.                 "C and ARexx code, with documentation? This will allow "
  71.                 "you to create public interface modules of your own, if "
  72.                 "you own the SAS C compiler and have typical Amiga "
  73.                 "developer skills.")
  74.                 (help @askoptions-help "If you are NOT a technical type, "
  75.                 "you have no need for this data. If you are, then by all "
  76.                 "means install it!")
  77.         (choices "Install SAS C and ARexx developer code?")
  78.         (default 0)
  79.     )
  80. )
  81.  
  82. ; Check with user if they want the docs on-disk
  83. ;----------------------------------------------
  84. (set doc_install
  85.     (askoptions
  86.         (prompt "Would you like to install the additional documents "
  87.                 "into the Imagemaster drawer? This is not usually "
  88.                 "necessary, because they can be printed by clicking "
  89.                 "on the \"print-docs\" icon at any time, if you have "
  90.                 "a printer.")
  91.         (help "If you do NOT have a printer, you'll have to read the "
  92.               " documents using a text editor, and you SHOULD install "
  93.               "them to the Imagemaster drawer. "
  94.               @askoptions-help)
  95.         (choices "Install addendum into Imagemaster drawer?")
  96.         (default 0)
  97.     )
  98. )
  99.  
  100. ; Check with user if they want the floating point version
  101. ;--------------------------------------------------------
  102. (set float_install
  103.     (askchoice
  104.         (prompt "Do you have a floating-point unit (FPU)? ")
  105.         (help "An FPU is a special hardware mathematics processor "
  106.               "which allows a computer which uses it to figure out "
  107.               "answers to math problems using floating point math "
  108.               "much faster than it could without an FPU. A 68000 "
  109.               "Amiga has no FPU. 68020 or 68030 based-Amigas may "
  110.               "have an FPU - check your documentation if you're not "
  111.               "certain. 68040-based Amigas always have the FPU built "
  112.               "right in. The non-FPU version will work on an Amiga "
  113.               "with an FPU, however it will be much slower which "
  114.               "will cost you unecessary time when processing images. "
  115.               @askchoice-help)
  116.         (choices "Install Floating Point (FPU) version"
  117.                  "Install standard (NON-FPU) version")
  118.         (default 1)
  119.     )
  120. )
  121.  
  122. ; We know where Imagemaster is to be installed now, we'll do some
  123. ; checking to make sure that we have enough room for the installation.
  124. ; The IM release is (approximately) sized as follows:
  125. ;---------------------------------------------
  126. ; Imagemaster ------------------- 1400000 bytes
  127. ; FilmView ----------------------   45000 bytes
  128. ; IShapes -----------------------   21000 bytes
  129. ; Addendum file -----------------  190000 bytes
  130. ; Developer stuff ---------------   16000 bytes
  131. ; Public Interface Modules ------ 1300000 bytes
  132. ;                                 -------
  133. ;                       Total:    2972000 bytes - about 3 megabytes
  134. ;-----------------------------------------------------------------------
  135. (set tgt_space  (getdiskspace user_place))
  136. (set total_size 3000000)
  137. (if (= dev_install 0)
  138.     (set total_size (- total_size "16000"))
  139. )
  140. (if (= doc_install 0)
  141.     (set total_size (- total_size "190000"))
  142. )
  143.  
  144. ; If we can't do the main install, quit immediately
  145. ;
  146. (if (< tgt_space total_size)
  147.     (abort "This installation requires about " ("%ld" total_size)
  148.            " bytes free on the "
  149.            "volume where you wish to install Imagemaster. Please "
  150.            "make this space available and then re-install. For your "
  151.            "information, the volume you have selected has only "
  152.            ("%ld " tgt_space) "bytes free. You need "
  153.            ("%ld " (- total_size tgt_space)) "more bytes.")
  154. )
  155.  
  156. ; We'll need our compressed-file extraction command:
  157. ;---------------------------------------------------
  158. (set src_disk "IM_Install2:")
  159. (askdisk
  160.     (prompt "Please insert Imagemaster diskette #2")
  161.     (help "We need to copy some files from this diskette.")
  162.     (dest "IM_Install2")
  163. )
  164.  
  165. ; Get the extract command
  166. ;------------------------
  167. (copyfiles (source src_disk)
  168.            (dest "ram:")
  169.            (pattern "extract")
  170.            (files)
  171. )
  172.  
  173. ; Now we'll get a grip on our installation volume
  174. ;------------------------------------------------
  175.  
  176. (set src_one "IM_Install1")
  177. (set src_two "IM_Install2")
  178. (set src_three "IM_Install3")
  179. (set src_four "IM_Install4")
  180. ; We've got the target; now we need to make sure that we have our main DIR
  181. ;-------------------------------------------------------------------------
  182. (
  183.     (set im_dest (tackon user_place "Imagemaster"))
  184.     (if (not (exists im_dest))
  185.         (makedir im_dest (infos))
  186.     )
  187.     (set @default-dest im_dest)
  188. )
  189.  
  190. ; Create subordinate target strings
  191. ;----------------------------------
  192. (set rxpi_dir (tackon im_dest "rxpi"))
  193. (set wipe_dir (tackon rxpi_dir "wipes"))
  194. (set cmpi_dir (tackon im_dest "cmpi"))
  195. (set ish_dir  (tackon im_dest "IShapes"))
  196. (set dev_dir  (tackon im_dest "Developer"))
  197. (set doc_dir  (tackon im_dest "Docs"))
  198. (set lib_dir  "libs:")
  199. (set rexx_dir "rexx:")
  200.  
  201. ; Create RXPI drawer if it's not already there
  202. ;---------------------------------------------
  203. (if (not (exists rxpi_dir))
  204.     (makedir rxpi_dir (infos))
  205. )
  206.  
  207. ; Create wipes drawer if it's not already there
  208. ;----------------------------------------------
  209. (if (not (exists wipe_dir))
  210.     (makedir wipe_dir (infos))
  211. )
  212.  
  213. ; Create CMPI drawer if it's not already there
  214. ;---------------------------------------------
  215. (if (not (exists cmpi_dir))
  216.     (makedir cmpi_dir (infos))
  217. )
  218.  
  219. ; Create IShapes drawer if it's not already there
  220. ;------------------------------------------------
  221. (if (not (exists ish_dir))
  222.     (makedir ish_dir (infos))
  223. )
  224.  
  225. ; make assignments so user can operate immediately
  226. ;-------------------------------------------------
  227. (makeassign "RXPI" rxpi_dir (safe))
  228. (makeassign "CMPI" cmpi_dir (safe))
  229.  
  230. ; Check to see if user has old rxpi and cmpi installation
  231. ; If so, copy those files to the new location in case they
  232. ; have any aftermarket or custom PI modules in there...
  233. ;--------------------------------------------------------
  234. (if (exists "rexx:rxpi")
  235.     (
  236.         (set as_made 0) ; because we are in a new location!
  237.         (copyfiles (source "rexx:rxpi") (dest "rxpi:")
  238.                    (pattern "#?") (files))
  239.         (run "delete rexx:rxpi/#? QUIET")
  240.         (run "delete rexx:rxpi QUIET")
  241.     )
  242. )
  243.  
  244. (if (exists "c:cmpi")
  245.     (
  246.         (set as_made 0) ; because we are in a new location!
  247.         (copyfiles (source "c:cmpi") (dest "cmpi:")
  248.                    (pattern "#?") (files))
  249.         (run "delete rexx:cmpi/#? QUIET")
  250.         (run "delete rexx:cmpi QUIET")
  251.     )
  252. )
  253.  
  254. ; copy things we KNOW we need
  255. ;----------------------------
  256. (set imp_src src_two)
  257. (askdisk
  258.     (prompt ("Please insert the %s diskette " imp_src))
  259.     (help "This diskette is absolutely required to complete this "
  260.           "installation!")
  261.     (dest imp_src)
  262. )
  263. (copyfiles (source (cat imp_src ":"))
  264.            (dest "ram:")
  265.            (pattern "(ish.lzh|fv.lzh|imi.lzh)")
  266.            (files)
  267. )
  268.  
  269. ; Extract this portion of the installation
  270. ;-----------------------------------------
  271. (run ("ram:extract >con:0/50/640/100/extract -m e ram:imi %s/" im_dest))
  272. (run ("ram:extract >con:0/50/640/100/extract -m e ram:fv %s/" im_dest))
  273. (run ("ram:extract >con:0/50/640/100/extract -m e ram:ish %s/" ish_dir))
  274.  
  275. ; Decide about .info file name
  276. ;-----------------------------
  277. (if (= float_install 0)
  278.     (rename (tackon im_dest "iminfo") (tackon im_dest "imf.info")) ; then
  279.     (rename (tackon im_dest "iminfo") (tackon im_dest "im.info")) ; else
  280. )
  281.  
  282. ; Clean up after these archives
  283. ;------------------------------
  284. (delete "ram:ish.lzh")
  285. (delete "ram:fv.lzh")
  286. (delete "ram:imi.lzh")
  287.  
  288. ; Now, we'll extract the main image processor after figuring out which ver
  289. ;-------------------------------------------------------------------------
  290. (set imp_src src_two)
  291. (set proc_file "ima.lzh")
  292. (if (= float_install 0)
  293.     (
  294.         (set imp_src src_one)
  295.         (set proc_file "imb.lzh")
  296.     )
  297. )
  298.  
  299. ; Ask for the proper diskette
  300. ;----------------------------
  301. (askdisk
  302.     (prompt ("Please insert the %s diskette " imp_src))
  303.     (help "This diskette is absolutely required to complete this "
  304.           "installation!")
  305.     (dest imp_src)
  306. )
  307.  
  308. ; This gets the needed archive from the proper disk
  309. ;--------------------------------------------------
  310. (copyfiles (source (cat imp_src ":"))
  311.            (dest "ram:")
  312.            (pattern proc_file)
  313.            (files)
  314. )
  315.  
  316. ; Here, we extract the image processor, copying it at the same time
  317. ;------------------------------------------------------------------
  318. (run ("ram:extract >con:0/50/640/100/extract -m e ram:%s %s/" proc_file im_dest))
  319.  
  320. ; Delete the image processor archive
  321. ;-----------------------------------
  322. (delete ("ram:%s" proc_file))
  323.  
  324. ; Now we'll go after the two optional installs and the PI modules
  325. ;----------------------------------------------------------------
  326. (set imp_src src_three)
  327. (askdisk
  328.     (prompt ("Please insert the %s diskette " imp_src))
  329.     (help "This diskette is absolutely required to complete this "
  330.           "installation!")
  331.     (dest imp_src)
  332. )
  333.  
  334. ; If user wants the developer stuff, install it
  335. ;----------------------------------------------
  336. (if (= dev_install 1)
  337.     (
  338.         (if (not (exists dev_dir))
  339.             (makedir dev_dir (infos))
  340.         )
  341.         (copyfiles (source (cat imp_src ":"))
  342.                    (dest "ram:")
  343.                    (pattern "dd.lzh")
  344.                    (files))
  345.         (run ("ram:extract >con:0/50/640/100/extract -m e ram:dd %s/" dev_dir))
  346.         (delete "ram:dd.lzh")
  347.     )
  348. )
  349.  
  350. ; Get the archive....
  351. ;----------------------------------------------------
  352. (makedir "ram:gbzyx")
  353. (copyfiles (source (cat imp_src ":"))
  354.            (dest "ram:")
  355.            (pattern "piarc.lzh")
  356.            (files)
  357. )
  358.  
  359. ; Install the dctv.library for reading and writing dctv pix
  360. ;----------------------------------------------------------
  361. (set imp_src src_four)
  362. (askdisk
  363.     (prompt ("Please insert the %s diskette " imp_src))
  364.     (help "This diskette is required to install "
  365.           "dctv.library, and possibly the addendum "
  366.           "documentation, if you asked for it on disk.")
  367.     (dest imp_src)
  368. )
  369. (copyfiles (source (cat imp_src ":"))
  370.            (dest "ram:")
  371.            (pattern "dc.lzh")
  372.            (files)
  373. )
  374. (run ("ram:extract >con:0/50/640/100/extract -m e ram:dc ram:"))
  375. (copylib (source "ram:dctv.library")
  376.          (dest "libs:")
  377. )
  378. (delete "ram:dc.lzh")
  379. (delete "ram:dctv.library")
  380.  
  381.  
  382. ; If user wants the documents, install them
  383. ;------------------------------------------
  384. (if (= doc_install 1)
  385.     (
  386.         (if (not (exists doc_dir))
  387.             (makedir doc_dir (infos))
  388.         )
  389.         (copyfiles (source (cat imp_src ":"))
  390.                    (dest "ram:")
  391.                    (pattern "ia.lzh")
  392.                    (files)
  393.         )
  394.         (run ("ram:extract >con:0/50/640/100/extract -m e ram:ia %s/" doc_dir))
  395.         (delete "ram:ia.lzh")
  396.     )
  397. )
  398.  
  399. ; Now for the FUN part... get the PI modules installed
  400. ; Begin by backing up old macro file(s), if they exist
  401. ;-----------------------------------------------------
  402. (if (exists "s:Default.immcr.old")
  403.     (delete "s:Default.immcr.old"))
  404. (if (exists "s:Default.immcr")
  405.     (rename "s:Default.immcr" "s:Default.immcr.old"))
  406. ;---------------
  407. (if (exists "s:Default.iimcr.old")
  408.     (delete "s:Default.iimcr.old"))
  409. (if (exists "s:Default.iimcr")
  410.     (rename "s:Default.iimcr" "s:Default.iimcr.old"))
  411. ;---------------
  412. (if (exists "s:Default.ipmcr.old")
  413.     (delete "s:Default.ipmcr.old"))
  414. (if (exists "s:Default.ipmcr")
  415.     (rename "s:Default.ipmcr" "s:Default.ipmcr.old"))
  416. ;---------------
  417.  
  418. ; Old macros are backed up, ready for main PI install
  419. ; Now really extract the stuff
  420. ;----------------------------------------------------
  421. (run ("ram:extract >con:0/50/640/100/extract -m e ram:piarc ram:gbzyx/"))
  422. (delete "ram:piarc.lzh")
  423.  
  424. ; Archive is unpacked and ready to copy
  425. ; first, backup list.list if available
  426. ;--------------------------------------
  427. (if (exists "cmpi:list.list")
  428.     (
  429.         (if (exists "cmpi:list.list.old")
  430.             (delete "cmpi:list.list.old")
  431.         )
  432.         (rename "cmpi:list.list" "cmpi:list.list.old")
  433.         (message "Please note that during installation, your previous "
  434.                  "\"list.list\" file was located and renamed to "
  435.                  "\"list.list.old\". All of your aftermarket PI "
  436.                  "modules (if any) are still intact, but will not "
  437.                  "show up on PI lists untill the new list.list file "
  438.                  "has been appropriately modified."
  439.          (help   "This has been done so that you may refer to it if "
  440.                  "you had aftermarket PI modules declared in it. "
  441.                  "A new list.list file has been created as part of "
  442.                  "this install procedure - you should use this new "
  443.                  "list.list file instead of the old one (that will "
  444.                  "happen automatically) but if you DID have any "
  445.                  "aftermarket PI modules, such as Metadigm's ES300c "
  446.                  "scanner driver, you'll need to add the control "
  447.                  "line(s) for it (them) into the new list.list file. "
  448.                  "You would then use the old list.list file as a template "
  449.                  "to accomplish this.")
  450.         )
  451.     )
  452. )
  453.  
  454. ; move the "odd" files (not PI rexx or PI cmds)
  455. ;----------------------------------------------
  456. (copyfiles (source "ram:gbzyx") (dest "rexx:")
  457.            (pattern "(picmdpath|launch.rexx)") (files))
  458. (copyfiles (source "ram:gbzyx") (dest "s:")
  459.            (pattern "(default.??mcr)") (files))
  460. (copyfiles (source "ram:gbzyx") (dest "cmpi:")
  461.            (pattern "list.list") (files))
  462. (copyfiles (source "ram:gbzyx") (dest "rxpi:wipes")
  463.            (pattern "#?.rxwp") (files))
  464. (delete "ram:gbzyx/picmdpath")
  465. (delete "ram:gbzyx/list.list")
  466. (delete "ram:gbzyx/launch.rexx")
  467. (run "delete ram:gbzyx/Default.??mcr QUIET")
  468. (run "delete ram:gbzyx/#?.rxwp QUIET")
  469.  
  470. ; Next, copy all the PI ARexx scripts
  471. ;------------------------------------
  472. (copyfiles (source "ram:gbzyx") (dest "rxpi:")
  473.            (pattern "#?.rexx") (files))
  474. (run "delete ram:gbzyx/#?.rexx QUIET")
  475.  
  476. ; Next, copy all the PI Commands
  477. ;-------------------------------
  478. (copyfiles (source "ram:gbzyx") (dest "cmpi:")
  479.            (pattern "#?") (files))
  480.  
  481. ; Now, we have to decide if we can install the FPU PI modules
  482. ;------------------------------------------------------------
  483. (if (exists "CMPI:rdjpg") (delete "CMPI:rdjpg"))
  484. (if (exists "CMPI:wrjpg") (delete "CMPI:wrjpg"))
  485. (if (= float_install 0)
  486.     ((rename "CMPI:x_JPR030" "CMPI:rdjpg")  ; then
  487.      (rename "CMPI:x_JPW030" "CMPI:wrjpg"))
  488.     ((rename "CMPI:x_JPR000" "CMPI:rdjpg")  ; else
  489.      (rename "CMPI:x_JPW000" "CMPI:wrjpg"))
  490. )
  491.  
  492. ; clean up
  493. ;---------
  494. (run "delete CMPI:x_#? QUIET")
  495. (run "delete ram:gbzyx/#? QUIET")
  496. (delete "ram:gbzyx")
  497. (delete "ram:extract")
  498.  
  499. ; Add assignment to user's "user-startup" directory for new boot ops
  500. ; IF they were not already correctly done
  501. ;-------------------------------------------------------------------
  502. (if (= as_made 0)
  503.     (startup "Imagemaster"
  504.         (help "This operation adds lines to your user-startup file "
  505.               "which are harmless assignment statements to drawers "
  506.               "within the Imagemaster drawer, called \"RXPI:\" and "
  507.               "\"CMPI:\" each time you boot your Amiga. These assignments "
  508.               "are used to let Imagemasters Public Interface (PI) drivers know "
  509.               "where its data files reside. Unless you know that you have "
  510.               "another assignment with one of these names, it is extremely "
  511.               "unlikely that there would be any reason to NOT let this happen. "
  512.               "Note that if this is a reinstall, but it is the first time "
  513.               "you have installed using this installation procedure, you "
  514.               "SHOULD allow these assigns to be made, even if you had "
  515.               "assigns to RXPI and CMPI you created yourself. The PI "
  516.               "modules are now kept in a different location, so these new "
  517.               "assignments are necessary.")
  518.         (prompt "Is it o.k. to add two SAFE lines to your User-Startup "
  519.                 "file?")
  520.         (command ("assign RXPI: %s\n" rxpi_dir))
  521.         (command ("assign CMPI: %s" cmpi_dir))
  522.     )
  523. )
  524.  
  525. (exit)
  526.